﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Medianamik.Client.DTO
{
    public partial class MetaDTO : IEquatable<MetaDTO>
    {
        public MetaDTO()
        {
            Title = string.Empty;
            BrowserTitle = string.Empty;
            MetaDescription = string.Empty;
            MetaKeywords = string.Empty;
        }

        public MetaDTO(string title, string browserTitle, string metaDescription, string metaKeywords)
        {
            Title = title;
            BrowserTitle = browserTitle;
            MetaDescription = metaDescription;
            MetaKeywords = metaKeywords;
        }

        public string Title
        {
            get;
            private set;
        }

        public string BrowserTitle
        {
            get;
            private set;
        }

        public string MetaDescription
        {
            get;
            private set;
        }

        public string MetaKeywords
        {
            get;
            private set;
        }

        public bool Equals(MetaDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.Title, Title) && Equals(other.BrowserTitle, BrowserTitle) && Equals(other.MetaDescription, MetaDescription) && Equals(other.MetaKeywords, MetaKeywords);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (MetaDTO)) return false;
            return Equals((MetaDTO) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int result = (Title != null ? Title.GetHashCode() : 0);
                result = (result*397) ^ (BrowserTitle != null ? BrowserTitle.GetHashCode() : 0);
                result = (result*397) ^ (MetaDescription != null ? MetaDescription.GetHashCode() : 0);
                result = (result*397) ^ (MetaKeywords != null ? MetaKeywords.GetHashCode() : 0);
                return result;
            }
        }

        public static bool operator ==(MetaDTO left, MetaDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(MetaDTO left, MetaDTO right)
        {
            return !Equals(left, right);
        }
    }
}
